package flca.projbuilder.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class ZipHelper {

	public static String readZipEntry(ZipFile aZipFile, ZipEntry aZipEntry) throws FileNotFoundException, IOException {
		StringBuffer sb = new StringBuffer();
		InputStream is = aZipFile.getInputStream(aZipEntry);
		try {
			int ch = 0;
			while ((ch = is.read()) > -1) {
				sb.append((char) ch);
			}
			return sb.toString();
		} finally {
			if (is != null)
				is.close();
		}
	}

}
